class A:

    class B:
        def __init__(self, a) -> None:
            self.c = a.ok

    def __init__(self) -> None:
        self.ok = 'ok'
        self.b = self.B(self)

if __name__ == '__main__':
    a = A()
    print(a.b.c)
